package cn.cau.epidemicsurveysystem.bean;

import javax.persistence.*;
import java.util.Objects;

/**
 * @projectName: gp2022
 * @package: cn.cau.epidemicsurveysystem.bean
 * @className: PatientInfoBean
 * @author: zfy
 * @description: TODO
 * @date: 2022/3/3 0003 15:22
 * @version: 1.0
 */
@Entity
@Table(name = "patientInfo", schema = "gp2022", catalog = "")
public class PatientInfoBean {

    private int patientId;
    private String patientName;
    private String patientTele;
    private String patientAddress;
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private String patientIdCard;
    private Integer patientState;

    @Id
    @Column(name = "patientId")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getPatientId() {
        return patientId;
    }

    public void setPatientId(int patientId) {
        this.patientId = patientId;
    }

    @Basic
    @Column(name = "patientName")
    public String getPatientName() {
        return patientName;
    }

    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    @Basic
    @Column(name = "patientTele")
    public String getPatientTele() {
        return patientTele;
    }

    public void setPatientTele(String patientTele) {
        this.patientTele = patientTele;
    }

    @Basic
    @Column(name = "patientAddress")
    public String getPatientAddress() {
        return patientAddress;
    }

    public void setPatientAddress(String patientAddress) {
        this.patientAddress = patientAddress;
    }

    @Basic
    @Column(name = "patientIdCard")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public String getPatientIdCard() {
        return patientIdCard;
    }

    public void setPatientIdCard(String patientIdCard) {
        this.patientIdCard = patientIdCard;
    }

    @Basic
    @Column(name = "patientState")
    public Integer getPatientState() {
        return patientState;
    }

    public void setPatientState(Integer patientState) {
        this.patientState = patientState;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PatientInfoBean that = (PatientInfoBean) o;
        return patientId == that.patientId &&
                Objects.equals(patientName, that.patientName) &&
                Objects.equals(patientTele, that.patientTele) &&
                Objects.equals(patientAddress, that.patientAddress) &&
                Objects.equals(patientIdCard, that.patientIdCard) &&
                Objects.equals(patientState, that.patientState);
    }

    @Override
    public int hashCode() {

        return Objects.hash(patientId, patientName, patientTele, patientAddress, patientIdCard, patientState);
    }
}
